<form class="layui-form">
		<input type="hidden" name="id" />
		<div class="layui-form-item">
			<label class="layui-form-label">姓名</label>
			<div class="layui-input-inline">
				<input type="text"  name="rootname" class="layui-input" />
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">密码</label>
			<div class="layui-input-inline">
				<input type="password"  name="password" class="layui-input" />
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">真实姓名</label>
			<div class="layui-input-inline">
				<input type="text"  name="realname" class="layui-input" />
			</div>
		</div>
		<div class="layui-form-item">
			<label class="layui-form-label">电话</label>
			<div class="layui-input-inline">
				<input type="text"  name="phone" class="layui-input" />
			</div>
		</div>
		<div class="layui-form-item">
			<input type="hidden" name="head"  "/>
			<label class="layui-form-label">分类图片</label>
			<div class="layui-input-inline">
				<!-- 使用layui的上传图片的插件 -->
				<div class="layui-upload">
				  <button type="button" class="layui-btn" id="test1">上传图片</button>
				  <div class="layui-upload-list">
				    <img class="layui-upload-img" id="demo1" style="width: 92px;height: 92px;">
				    <p id="demoText"></p>
				  </div>
				  <div style="width: 95px;">
				    <div class="layui-progress layui-progress-big" lay-showpercent="yes" lay-filter="demo">
				      <div class="layui-progress-bar" lay-percent=""></div>
				    </div>
				  </div>
				</div> 
			</div>
		</div>
		
		<div class="layui-form-item">
			<label class="layui-form-label"></label>
			<div class="layui-input-inline">
				<button type="submit" class="layui-btn layui-btn-danger" 
					lay-submit lay-filter="edit">修改分类</button>
			</div>	
	</form>
<script src="./layui/layui.js" type="text/javascript" charset="utf-8"></script>
<script>

	layui.use(['form'],function(){
		alert(id);
		var form = layui.form;
		var $ =layui.$;
		$.ajax({
			url:'http://127.0.0.1:9000/api/root',
			type:'get',
			data:{id:id},
			dataType:'json',
			success:function(data){
				alert(JSON.stringify(data));
			},
			error:function(){
				
			}
		});
	})

</script>

	
	